package me.zhulu.classload;

/**
 * Hello world!
 *
 */
public class JvmClassLoadTest
{
    public static void main( String[] args )
    {
        Singleton mysingleton = Singleton.getInstance();
        System.out.println(mysingleton.a);
        System.out.println(mysingleton.b);

        System.out.println(mysingleton.c);
        System.out.println(mysingleton.d);
    }
}

class Singleton {
    public static Singleton singleton = new Singleton();
    public static int a;
    public static int b = 0;
//    public static Singleton singleton = new Singleton();

    public int c;

    public int d = 0;

    private Singleton(){
        super();
        a++;
        b++;

        c++;
        d++;
    }

    public static Singleton getInstance(){
        return singleton;
    }
}